import { defHttp } from '@/utils/http/axios'
import { GetAccountInfoModel } from '../demo/model/accountModel'

enum Api {
  GET_PRICE_LIST = '/energyPrice/page',
  ADD_RECORD_PRICE = '/energyPrice/add',
  UPDATE_RECORD_PRICE = '/energyPrice/modify',
  DELETE_RECORD_PRICE = '/energyPrice/remove',
  ADD_SETTING_PRICE = '/energyPrice/addOrModifyTime',
  SETTING_PRICE_DETAIL = '/energyPrice/getEnergyPriceTime',
  SETTING_PRICE_DETAIL2 = '/energyPrice/getEnergyPriceUsageByPriceId',
  ADD_PRICE_DETAIL2 = '/energyPrice/addNewEnergyPriceUsage',
  DELETE_PRICE_DETAIL2 = '/energyPrice/removeEnergyPriceUsage',
  DELETE_PRICE_modifyHistoryPrice = '/energyPrice/modifyHistoryPrice',
}

export const getPriceList = (data) =>
  defHttp.post<GetAccountInfoModel>({ url: Api.GET_PRICE_LIST, data })

export const addRecordPrice = (data) => defHttp.post<void>({ url: Api.ADD_RECORD_PRICE, data })
export const updateRecordPrice = (data) =>
  defHttp.post<void>({ url: Api.UPDATE_RECORD_PRICE, data })
export const deleteRecordPrice = (data) =>
  defHttp.post<void>({ url: Api.DELETE_RECORD_PRICE, data })
export const addSettingPrice = (data) => defHttp.post<void>({ url: Api.ADD_SETTING_PRICE, data })
export const getSettingPriceDetail = (params) =>
  defHttp.get<void>({ url: Api.SETTING_PRICE_DETAIL, params })
export const getSettingPriceDetail2 = (params) =>
  defHttp.get<void>({ url: Api.SETTING_PRICE_DETAIL2, params })
export const addSettingPriceDetail2 = (data) =>
  defHttp.post<void>({ url: Api.ADD_PRICE_DETAIL2, data })
export const deleteRecordPrice2 = (data) =>
  defHttp.post<void>({ url: Api.DELETE_PRICE_DETAIL2, data })
export const modifyHistoryPrice = (data) =>
  defHttp.post<void>({ url: Api.DELETE_PRICE_modifyHistoryPrice, data })
